﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Net;
using System.IO;

namespace GetData
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnGetLink_Click(object sender, EventArgs e)
        {
            try
            {
                HttpWebRequest wr = (HttpWebRequest)HttpWebRequest.Create(tbxLink.Text);
                WebResponse wp = wr.GetResponse();
                Stream wstr = wp.GetResponseStream();
                StreamReader sr = new StreamReader(wstr);
                tbxSource.Text = sr.ReadToEnd();
                sr.Close();
                wstr.Close();
                wp.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
